﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Services;
using NS.Utilities;
using BLL;
using Model;

public partial class Platform_WashPriceManager : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            GridViewDataBind();
        }
    }
    private void GridViewDataBind()
    {
        FGridView1.SQLString = WashPirceService.GetAllWashPirce_SQL();
        FGridView1.PKey = "ID";
        FGridView1.OrderName = "ID";
        FGridView1.BindData();
        FGridView1.AddControl();
    }
    protected void btnBindData_Click(object sender, EventArgs e)
    {
        GridViewDataBind();
    }
    protected void LBAdd_Click(object sender, EventArgs e)
    {
        //WashPirce Model = new WashPirce();
        //Model.Project = txtProject.Text.Trim();
        //Model.Pirce = decimal.Parse(txtPirce.Text.Trim());
        //Model.Times = int.Parse(txtTimes.Text.Trim());

        //if (WashPirceService.AddWashPirce(Model) > 0)
        //{
        //    txtProject.Text = string.Empty;
        //    GridViewDataBind();
        //    MessageBox.ShowSaveSuccess(this);
        //}
        //else
        //{
        //    MessageBox.ShowSaveError(this);
        //}
    }

    protected void DelButton_Click(object sender, EventArgs e)
    {
        string DelID = ((Button)sender).CommandArgument.ToString();
        WashPirceService.DeleteWashPirceById(int.Parse(DelID));
        GridViewDataBind();
    }
}